//package com.shycloud.mido.member.annotation;
//
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject;
//import com.alibaba.fastjson.serializer.SerializerFeature;
//import com.fasterxml.jackson.databind.ObjectMapper;
//import com.shycloud.mido.common.core.util.R;
//import lombok.SneakyThrows;
//import org.aspectj.lang.annotation.AfterReturning;
//import org.aspectj.lang.annotation.Aspect;
//import org.aspectj.lang.annotation.Pointcut;
//import org.springframework.stereotype.Component;
//import org.springframework.web.context.request.RequestContextHolder;
//import org.springframework.web.context.request.ServletRequestAttributes;
//
//import javax.servlet.http.HttpServletRequest;
//
//@Component
//@Aspect
//public class LogRAspect {
//
//	@Pointcut("execution(public * com.shycloud.mido.member.controller.*.*(..))")
//	public void webLog() {
//	}
//
//	@SneakyThrows
//	@AfterReturning(returning = "r", pointcut = "webLog()")
//	public void doAfterReturning(R r) {
//		ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
//		HttpServletRequest request = attributes.getRequest();
//		String authorization = request.getHeader("Authorization");
//		System.out.println("token======> " + authorization);
//		// 记录下请求内容
//		System.out.println("==============接口：{" + request.getRequestURL().toString() + "}返回的结果 START=================================================================================");
//		ObjectMapper mapper = new ObjectMapper();
//		String json = mapper.writeValueAsString(r);
//
//		JSONObject object = JSONObject.parseObject(json);
//		String pretty = JSON.toJSONString(object, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue,
//				SerializerFeature.WriteDateUseDateFormat);
//		System.out.println(pretty);
//		System.out.println("==============返回的结果 END=================================================================================");
//	}
//
//}
